<!-- <link rel="stylesheet" href="../layui/css/layui.css" /> -->
<link rel="stylesheet" href="../css/category.css">
<style>
    /* .layui-laypage-yanse {
        border-radius: 5px !important;
        color: yellow !important;
    } */
</style>
<div class="category-container">
    <button class="layui-btn btn-black" id="hlq_btn">+新增菜品分类</button>
    <button class="layui-btn add" id="hlq_add">+新增套餐分类</button>

    <table class="layui-table hlq-table" lay-skin="line" lay-size="lg">
        <colgroup>
            <col width="150">
            <col width="200">
            <col>
        </colgroup>
        <thead>
            <tr>
                <th>分类名称</th>
                <th>分类类型</th>
                <th>操作时间</th>
                <th>排序</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>贤心</td>
                <td>2016-11-29</td>
                <td>人生就像是一场修行</td>
                <td>人生就像是一场修行</td>
                <td>
                    <a href="javascript:;" id="hlq_alter">修改</a>
                    <a href="javascript:;" id="hlq_del">删除</a>
                </td>
            </tr>

        </tbody>
    </table>
    <!-- 分页区域 -->
    <div id="pageBox"></div>

    <!-- 新增菜品分类 -->
    <script type="text/html" id="food-add">
        <form class="layui-form hlq_l" id="form-add">
            <div class="layui-form-item">
                <label class="layui-form-label">分类名称</label>
                <div class="layui-input-block">
                    <input type="text" name="name" required lay-verify="required" placeholder="请输入分类名称" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item" id="hlq_b">
                <label class="layui-form-label">排序</label>
                <div class="layui-input-block">
                    <input type="text" name="alias" required lay-verify="required" placeholder="请输入排序" autocomplete="off" class="layui-input" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="reset" class="layui-btn layui-btn-primary layui-layer-close layui-layer-close1 hlq_foots ">取消</button>
                    <button class="layui-btn add" lay-submit lay-filter="formDemo" id="hlq_confirm">确定</button>

                    <button class="layui-btn btn-black" type="reset" id="hlq_fd">保存并继续添加</button>

                </div>
            </div>


        </form>
    </script>
    <!-- 新增套餐分类 -->
    <script type="text/html" id="combo-add">
        <form class="layui-form" id="form-combo">
            <div class="layui-form-item">
                <label class="layui-form-label">分类名称</label>
                <div class="layui-input-block">
                    <input type="text" name="name" required lay-verify="required" placeholder="请输入分类名称" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item" id="hlq_b">
                <!-- 只能输入纯数字 -->
                <label class="layui-form-label">排序</label>
                <div class="layui-input-block">
                    <input type="text" name="alias" required lay-verify="required" placeholder="请输入排序" autocomplete="off" class="layui-input" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="reset" class="layui-btn layui-btn-primary layui-layer-close layui-layer-close1">取消</button>
                    <button class="layui-btn add hlq_l" lay-submit lay-filter="formDemo" id="hlq_l">确定</button>
                    <button class="layui-btn btn-black" type="reset" id="hlq_re">保存并继续添加 </button>
                </div>
            </div>
        </form>
    </script>
    <!-- 编辑页面 -->
    <script type="text/html" id="combo-edit">
        <form class="layui-form" id="form-edit">
            <input type="hidden" name="id">
            <div class="layui-form-item">
                <label class="layui-form-label">分类名称</label>
                <div class="layui-input-block">
                    <input type="text" name="name" required lay-verify="required" placeholder="请输入分类名称" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item" id="hlq_b">
                <label class="layui-form-label">排序</label>
                <div class="layui-input-block">
                    <input type="text" name="alias" required lay-verify="required" placeholder="请输入排序" autocomplete="off" class="layui-input" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block" id="hlq_btns">
                    <button type="reset" class="layui-btn layui-btn-primary layui-layer-close layui-layer-close1">取消</button>
                    <button class="layui-btn add" lay-submit lay-filter="formDemo" id="hlq_r">确定</button>

                </div>
            </div>
        </form>

    </script>
</div>
<script src="../js/lib/template-web.js"></script>
<script type="text/html" id="tpl">

    {{each data.records}}
    <tr>
        <td>{{$value.name}}</td>
        <td>{{$value.type | dateFormat }}</td>
        <td>{{$value.createTime}}</td>
        <td>{{$value.sort}}</td>
        <td>
            <a href="javascript:;" id="hlq_alter" data-id="{{$value.id}}">修改</a>
            <a href="javascript:;" id="hlq_del" data-id="{{$value.id}}">删除</a>
        </td>
    </tr>
    {{/each}}
</script>
<!-- <script src="../layui/layui.js"></script> -->

<script src="../js/hlq-category.js"></script>